package com.example.lib_apply.detail

import com.example.lib_apply.ApiService
import com.example.lib_common.mvi.BaseRepository
import com.example.lib_common.mvi.ResponseEntity
import com.example.network_sdk.HttpType
import com.example.network_sdk.NetWorkFactory
import kotlinx.coroutines.flow.Flow

class DetailRepository : BaseRepository() {
    fun requestParkingEntity(map: HashMap<String,Any>) : Flow<ResponseEntity<List<ParkingEntity>>> {
        return NetWorkFactory.factory(HttpType.TOKENSIGN)!!
            .create(ApiService::class.java)
            .requestParkingStep(createBody(map))
    }

    fun requestVisitorEntity(map: HashMap<String,Any>) : Flow<ResponseEntity<List<VisitorEntity>>> {
        return NetWorkFactory.factory(HttpType.TOKENSIGN)!!
            .create(ApiService::class.java)
            .requestVisitorStep(createBody(map))
    }
}